
import { Navigate } from 'react-router-dom'
import { ReactElement } from 'react'
import LoginPage from '../views/login'
import HomePage from '../views/home'
import HomePage_PanoramicMonitoringPage from '../views/home/page/panoramicMonitoring'
import HomePage_SubstationEnergyConsumptionPage from '../views/home/page/substationEnergyConsumption'
import HomePage_SubstationEnergyConsumptionPage_RealTimePowerPage from '../views/home/page/substationEnergyConsumption/page/realTimePower'
import HomePage_SubstationEnergyConsumptionPage_EnergyConsumptionStatisticsPage from '../views/home/page/substationEnergyConsumption/page/energyConsumptionStatistics'
import HomePage_PowerSupplyQualityOfSubstationPage from '../views/home/page/powerSupplyQualityOfSubstation'
import HomePage_DataManagementPage from '../views/home/page/dataManagement'
import HomePage_DataManagementPage_SiteAccountPage from '../views/home/page/dataManagement/page/siteAccount'
import HomePage_DataManagementPage_EventStatisticsPage from '../views/home/page/dataManagement/page/eventStatistics'
import HomePage_DataManagementPage_RecordingDataPage from '../views/home/page/dataManagement/page/recordingData'
import HomePage_DataManagementPage_DataExportPage from '../views/home/page/dataManagement/page/dataExport'
import HomePage_SystemConfigurationPage from '../views/home/page/systemConfiguration'
import HomePage_SystemConfigurationPage_OperationLogPage from '../views/home/page/systemConfiguration/page/operationLog'
import HomePage_SystemConfigurationPage_AccountManagementPage from '../views/home/page/systemConfiguration/page/accountManagement'
import HomePage_DataManagementPage_HistoricalCurvePage from '../views/home/page/dataManagement/page/historicalCurve'


interface Router {
  path: string,
  title: string,
  element: ReactElement,
  children?: Array<Router>
}


const routerList: Array<Router> = [
  {
    path: '/home',
    title: "主页",
    element: <HomePage />,
    children: [
      {
        path: 'panoramicMonitoring',
        title: "全景监控",
        element: <HomePage_PanoramicMonitoringPage />,
      },
      {
        path: 'substationEnergyConsumption',
        title: "变电站能耗",
        element: <HomePage_SubstationEnergyConsumptionPage />,
        children: [
          {
            path: 'realTimePower',
            title: "实施功率",
            element: <HomePage_SubstationEnergyConsumptionPage_RealTimePowerPage />,
          },
          {
            path: 'energyConsumptionStatistics',
            title: "能耗统计",
            element: <HomePage_SubstationEnergyConsumptionPage_EnergyConsumptionStatisticsPage />,
          },
          {
            path: '',
            title: "主页/变电站能耗/默认页面",
            element: <Navigate to="/home/substationEnergyConsumption/realTimePower" />,
          },
        ],
      },
      {
        path: 'powerSupplyQualityOfSubstation',
        title: "变电所供电品质",
        element: <HomePage_PowerSupplyQualityOfSubstationPage />,
      },
      {
        path: 'dataManagement',
        title: "数据管理",
        element: <HomePage_DataManagementPage />,
        children: [
          {
            path: 'siteAccount',
            title: "站点台账",
            element: <HomePage_DataManagementPage_SiteAccountPage />,
          },
          {
            path: 'historicalCurve',
            title: "历史曲线",
            element: <HomePage_DataManagementPage_HistoricalCurvePage />,
          },
          {
            path: 'eventStatistics',
            title: "事件统计",
            element: <HomePage_DataManagementPage_EventStatisticsPage />,
          },
          {
            path: 'recordingData',
            title: "录波时长",
            element: <HomePage_DataManagementPage_RecordingDataPage />,
          },
          {
            path: 'dataExport',
            title: "数据导出",
            element: <HomePage_DataManagementPage_DataExportPage />,
          },
          {
            path: '',
            title: "主页/数据管理/默认页面",
            element: <Navigate to="/home/dataManagement/siteAccount" />,
          },
        ],
      },
      {
        path: 'systemConfiguration',
        title: "系统配置",
        element: <HomePage_SystemConfigurationPage />,
        children: [
          {
            path: 'operationLog',
            title: "操作日志",
            element: <HomePage_SystemConfigurationPage_OperationLogPage />,
          },
          {
            path: 'accountManagement',
            title: "账号管理",
            element: <HomePage_SystemConfigurationPage_AccountManagementPage />,
          },
          {
            path: '',
            title: "主页/系统配置/默认页面",
            element: <Navigate to="/home/systemConfiguration/operationLog" />,
          },
        ],
      },
      {
        path: '',
        title: "主页/默认页面",
        element: <Navigate to="/home/panoramicMonitoring" />,
      },
    ],
  },

  {
    path: '/login',
    title: "登录",
    element: <LoginPage />,
  },
  {
    path: '/',
    title: "默认页面",
    element: <Navigate to="/login" />,
  },
  {
    path: '*',
    title: "默认页面",
    element: <Navigate to="/login" />,
  },
]


export default routerList